package com.byxy.ssm.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.byxy.ssm.demo.entity.Forum;
import com.byxy.ssm.demo.service.ForumService;

@Controller
public class TipController {

	@Autowired private ForumService forumService;
	@GetMapping("toPublishTipPage.do")
	public String add(Model model) {
		List<Forum> forums = forumService.findAll();
		model.addAttribute("forums", forums);
		
		return "publishTip";
	}
}
